-
Couldn't load subscription status.
- Fork 318
[http-client-csharp] add regen preview local validation script #8819
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
[http-client-csharp] add regen preview local validation script #8819
Conversation
|
No changes needing a change description found. |
|
You can try these changes here
|
045f8f5 to
e281f31
Compare
e281f31 to
91653c8
Compare
| - Clean and build the unbranded and Azure generators with local changes | ||
| - Display an interactive menu to select which libraries to regenerate | ||
| - Regenerate only the selected libraries | ||
| - Restore all modified files on success |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this true? I think we leave the generated library changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should only be restoring the metadata files (package.json edits) on success. I'll update this text
|
|
||
| Write-Host "=============================================================" -ForegroundColor Cyan | ||
| Write-Host "" | ||
| Write-Host "Enter library numbers to regenerate (comma-separated), 'all' for all libraries, or 'q' to quit:" -ForegroundColor White |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I think we should be able to just leave it blank for all.
| Prompts for library selection before regenerating. | ||
|
|
||
| .EXAMPLE | ||
| .\RegenPreview-Local.ps1 -AzureSdkForNetRepoPath "C:\repos\azure-sdk-for-net" -All |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: probably can just name it RegenPreview unless we were thinking of having a separate script that we would use for pipeline runs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was planning on having a separate process/script for pipeline runs, but I'll go ahead and rename it in case I can just reuse this script there.
| 2. Builds and packages the three NuGet generator framework packages with the same versioning | ||
| 3. Updates Packages.Data.props in azure-sdk-for-net with the local NuGet version | ||
| 4. Updates the Azure generator (@azure-typespec/http-client-csharp) to use the local unbranded generator | ||
| 5. Builds and packages the Azure generator locally |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we also add in the steps to update the Mgmt generator and regen the mgmt libraries?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also would be great to include OpenAI if possible.
| -DependencyType "dependencies" | ||
|
|
||
| # Clean and install | ||
| Push-Location $azureGeneratorPath |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: can we use the Invoke function from Generation.psm1?
|
I tested this locally making a change in CodeWriter to the auto-generated string and ran for all libraries, but only Azure.AI.Projects showed any diffs. |
Strange. I tested this on 2 separate machines and it worked fine. I'll need to debug to see why that would happen. |
Hmm let me try again. |
Nevermind - I must have been looking at an out of sync diff. It is working as expected. |
This PR adds a new regen preview developer script to aid in testing and validating changes made to the generator. It allows regenerating azure libraries locally using the local artifacts of the generator, helping to see what the regenerated code will look like with the applied changes.
contributes to: Azure/azure-sdk-for-net#52234
example run:
